<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    * {
        margin: 0;
        padding: 0;
        /* c3盒模型 */
        box-sizing: border-box;
    }

    #dv {
        margin: 100px auto;
        width: 500px;
        height: 400px;
        border: 1px solid red;
        /* 控制渐变的方向 to right to left to top to bottom */
        /* background-image: linear-gradient(to right, red, white); */
        /* 默认从上到下 to bottom */
        /* background-image: linear-gradient(red, white); */

        /* 重复的渐变 */
        /* 90deg=to left  180deg=to bottom  270deg=to right 360deg=to top*/
        /* background-image: repeating-linear-gradient(90deg, red, white 250px); */
        /* 250px是dv盒子宽度的一半 */
        background-image: repeating-linear-gradient(to left, red, white 250px);
    }
</style>

<body>
    <div id="dv"></div>
</body>

</html>